﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BatchSetUserRights.aspx.cs"
    Inherits="SysManager_BatchSetUserRights" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>批量设置用户权限</title>
    <script>
        var edit = function (editor, e) {
            // Call DirectMethod
            if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
                CompanyX.Edit(e.record.data.mid, e.record.data.userid, e.field, e.originalValue, e.value, e.record.data);
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Default" />
        <ext:Viewport ID="Viewport1" runat="server">
            <LayoutConfig>
                <ext:HBoxLayoutConfig Align="Stretch" />
            </LayoutConfig>
            <Defaults>
                <ext:Parameter Name="margin" Value="2 0" Mode="Value" />
            </Defaults>
            <Items>
                <ext:GridPanel ID="GridPanel2" runat="server" Title="用户列表" Width="230" CollapseDirection="Left">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar1" runat="server">
                            <Items>
                                <ext:TextField runat="server" ID="txtuser" />
                                <ext:Button ID="Button1" runat="server" Text="查询" UI="Info">
                                    <DirectEvents>
                                        <Click OnEvent="BtnQueryUser">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store2" runat="server" PageSize="50" OnReadData="MyData_Refresh">
                            <Model>
                                <ext:Model ID="Model2" runat="server" IDProperty="用户ID">
                                    <Fields>
                                        <ext:ModelField Name="用户ID" ServerMapping="userid" />
                                        <ext:ModelField Name="用户编号" ServerMapping="usercode" />
                                        <ext:ModelField Name="用户名称" ServerMapping="username" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn2" runat="server" Width="35" Text="序号" />
                            <ext:Column ID="Column1" runat="server" Text="编号" DataIndex="用户编号" Width="80" />
                            <ext:Column ID="Column5" runat="server" Text="名称" DataIndex="用户名称" />
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel2" runat="server">
                            <DirectEvents>
                                <Select OnEvent="Cell_Click" />
                            </DirectEvents>
                        </ext:RowSelectionModel>
                    </SelectionModel>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar2" runat="server">
                            <Items>
                                <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer2" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox2" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="50" />
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="50" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager2" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
                <ext:GridPanel ID="GridPanel1" runat="server" Title="权限列表" Width="200" CollapseDirection="Left"
                    Flex="1" Split="true">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar2" runat="server" Layout="ColumnLayout" Padding="5">
                            <Items>
                                <ext:TextField runat="server" FieldLabel="条件" LabelWidth="60" ID="txtmodulename" EmptyText="输入模块编号/名称" />
                                <ext:Button ID="Button2" runat="server" Text="查询" UI="Info">
                                    <DirectEvents>
                                        <Click OnEvent="Cell_Click">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                                <ext:Component runat="server" Width="10000" Padding="5">
                                </ext:Component>
                                <ext:Button runat="server" Text="批量设置选中的浏览权限" UI="Success" OnDirectClick="BtnSetAllBrowse">
                                </ext:Button>
                                <ext:Button ID="Button3" runat="server" Text="批量设置选中的新增权限" UI="Info" >
                                </ext:Button>
                                <ext:Button ID="Button4" runat="server" Text="批量设置选中的删除权限" UI="Danger">
                                </ext:Button>
                                <ext:Button ID="Button5" runat="server" Text="批量设置选中的编辑权限" UI="Primary">
                                </ext:Button>
                                <ext:Button ID="Button6" runat="server" Text="批量设置选中的导出权限" UI="Info">
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="MyData_Refresh">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="mid">
                                    <Fields>
                                        <ext:ModelField Name="mid" ServerMapping="mid" />
                                        <ext:ModelField Name="userid" ServerMapping="userid" />
                                        <ext:ModelField Name="ModuleCode" ServerMapping="ModuleCode" />
                                        <ext:ModelField Name="ModuleName" ServerMapping="ModuleName" />
                                        <ext:ModelField Name="M_Add" ServerMapping="M_Add" />
                                        <ext:ModelField Name="M_Browse" ServerMapping="M_Browse" />
                                        <ext:ModelField Name="M_Delete" ServerMapping="M_Delete" />
                                        <ext:ModelField Name="M_Edit" ServerMapping="M_Edit" />
                                        <ext:ModelField Name="M_Export" ServerMapping="M_Export" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="35" Text="mid" />
                            <ext:Column ID="Column3" runat="server" Text="模块编号" DataIndex="ModuleCode" />
                            <ext:Column ID="Column4" runat="server" Text="模块名称" DataIndex="ModuleName" Width="200" />
                            <ext:CheckColumn ID="Column2" runat="server" Text="新增" DataIndex="M_Add" Width="80" />
                            <ext:CheckColumn ID="Column6" runat="server" Text="浏览" DataIndex="M_Browse" Width="80"
                                Editable="true" />
                            <ext:CheckColumn ID="Column7" runat="server" Text="删除" DataIndex="M_Delete" Width="80" />
                            <ext:CheckColumn ID="Column8" runat="server" Text="编辑" DataIndex="M_Edit" Width="80" />
                            <ext:CheckColumn ID="Column9" runat="server" Text="导出" DataIndex="M_Export" Width="80"
                                Editable="true" />
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" Mode="Multi">
                        </ext:RowSelectionModel>
                    </SelectionModel>
                    <Plugins>
                        <ext:CellEditing ID="CellEditing1" runat="server">
                            <Listeners>
                                <Edit Fn="edit" />
                            </Listeners>
                        </ext:CellEditing>
                    </Plugins>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="100" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="100" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
